﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;

namespace HigLabo.Net.Twitter
{
    public partial class TwitterClient
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public StatusCollection GetFavorites(Int64 userid)
        {
            var cm = new GetFavoritesCommand();
            cm.UserID = userid;
            return this.GetFavorites(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="screenName"></param>
        /// <returns></returns>
        public StatusCollection GetFavorites(String screenName)
        {
            var cm = new GetFavoritesCommand();
            cm.ScreenName = screenName;
            return this.GetFavorites(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public StatusCollection GetFavorites(GetFavoritesCommand command)
        {
            String jsonText = this.GetResultText(TwitterApiUrl.Version1_1.Favorites.GetFavoritesUrl, command);
            return new StatusCollection(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <param name="includeEntities"></param>
        /// <returns></returns>
        public Status CreateFavorites(Int64 id, Boolean includeEntities)
        {
            var cm = new CreateFavoritesCommand();
            cm.ID = id;
            cm.IncludeEntities = includeEntities;
            return this.CreateFavorites(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public Status CreateFavorites(CreateFavoritesCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Favorites.CreateFavoritesUrl, command);
            return new Status(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <param name="includeEntities"></param>
        /// <returns></returns>
        public Status DestroyFavorites(Int64 id, Boolean includeEntities)
        {
            var cm = new DestroyFavoritesCommand();
            cm.ID = id;
            cm.IncludeEntities = includeEntities;
            return this.DestroyFavorites(cm);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        public Status DestroyFavorites(DestroyFavoritesCommand command)
        {
            String jsonText = this.GetResultText(HttpMethodName.Post, TwitterApiUrl.Version1_1.Favorites.DestroyFavoritesUrl, command);
            return new Status(jsonText);
        }
    }
}
